﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sun.Mvc.Models;
using Sun.Mvc.DAL;
using Sun.Mvc.IDAL;
using Sun.Mvc.Factory;

namespace Sun.Mvc.BLL
{
    public class Article
    {
        private readonly static IDAL.IArticle dal = DataAccess.CreateArticle();

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Insert(Models.Article model)
        {
            return dal.Insert(model);
        }

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Update(Models.Article model)
        {
            return dal.Update(model);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public IQueryable<Models.Article> GetList()
        {
            return dal.GetList();
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }
    }
}
